import styled from 'styled-components'

interface StyledWrapProps {
	status: any
	nestingLevel: number
}

export const StyledWrap = styled.div.attrs(({ status }: StyledWrapProps) => ({
	className: status.isSelected ? 'selected' : '',
}))<StyledWrapProps>`
	white-space: nowrap;
	display: flex;
	align-items: center;
	margin: 2px 0;
	margin-left: ${({ nestingLevel, status: { isParent } }) =>
		isParent ? nestingLevel * 15 : (nestingLevel - 1) * 15}px;
	min-width: 210px;
	user-select: none;
	&:hover {
		color: #007ac0;
	}
	&.selected {
		color: #fff;
		background: url()
			no-repeat #5eb9ef;
		background: linear-gradient(90deg, #2d8bc0, #53afe4);
		.icon-arrow {
			background-position: ${({ status }) => (status.isOpen ? `-42px -1084px` : ` -98px -1084px`)};
		}
	}
	.icon-wrap {
		flex: 0 0 14px;
		display: flex;
		align-items: center;
		justify-content: center;
		margin-left: 4px;
		cursor: pointer;
	}
	.item-content {
		flex: 1;
		display: flex;
		align-items: center;
		margin-left: 4px;
		cursor: pointer;
		min-width: 0;
		.item-name {
			overflow: hidden;
			white-space: nowrap;
			text-overflow: ellipsis;
		}
	}
	.more-options {
		display: flex;
		height: 20px;
		align-items: center;
		span {
			margin-right: 4px;
		}
	}
`
export const StyledIPWrap = styled.div`
	height: 75px;
	color: #4e4e4e;
	position: fixed;
	z-index: 4444;
	border: 1px solid #b6bec5;
	background-color: #fff;
	padding: 5px 0;
	font-size: 12px;
	> div {
		margin: 10px 20px 10px 10px;
	}
`
export const StyledSimpleSearchItem = styled.div`
	width: 100%;
	display: flex;
	height: 43px;
	align-items: center;
	> span {
		flex: 0 0 32px;
	}
	.user-info {
		width: calc(100% - 37px);
		padding-left: 5px;
		display: flex;
		flex-direction: column;
		justify-content: center;
		> div {
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
		.dept-info {
			color: #ccc;
		}
	}
`
